package MicroSpring.aopProxy.handler;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/*
    aop处理类...
 */
public class AopHandler implements InvocationHandler {
    private Object bean;

    public Object getBean() {
        return bean;
    }

    public void setBean(Object bean) {
        this.bean = bean;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("aop前增强...");
        Object invoke = method.invoke(bean, args);
        System.out.println("aop后增强..");
        return invoke;
    }
}
